home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trading on the Edge
/
Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin
/
pc
/
mac_file
/
vendor_d
/
neuralwa
/
nw2v50
/
modnn.nnc
< prev
next >
Wrap
Text File
|
1993-08-23
|
2KB
|
70 lines
csv3.8
!************************************************************************
!* *
!* Modular Neural Network Control Strategy *
!* *
!************************************************************************
!
!MASK label op-code operands comment
L_saR_sa trace aux3 ! set trace option to aux3
L_saR_sa optclr op:bknc ! do not BKp to PEs w/o conns
Li_aR_sa cset recall,0 ! recall count
!
! Get input (learn and recall) and desired output (learn only)
!
L_saR_sa lset in ! input layer
L___R_sa io read ! get input data (recall)
L_saR___ io lrnin ! get input data (learn)
L_saR_sa lset out ! output layer
L_saR___ io lrnout ! get desired output (learn)
L___R_sa io rcltst ! get desired output (test)
!
! Start with the first layer for a forward pass through network
!
L_saR_sa lset in ! input layer
! Do summation separately to allow projective layers, and recurrence
L_saR_sa @rloop math sum|fire
L___R_sa math rnoise|tran|output|e=0
L_saR___ math lnoise|tran|output|e=0|fire
L_saR_sa lset cur,1 ! next layer
L_saR_sa lcmp out ! at output layer ?
L_saR_sa blt @rloop ! loop till done
!
! Compute final outputs
! Do summation separately to allow for recurrence
!
L_saR_sa math sum|fire
L___R_sa math rnoise|tran|output|fire
L_saR___ math lnoise|tran|output|fire
!
! Output
!
L___R_sa io write ! recall
L_saR___ io lrnrslt ! learn
!
! Back-propagate the desired output
!
L_saR___ math backp|fire ! learn
L_saR___ lset out,-1 ! gate layer
! Calculating posterior probabilities, modified errors,
! and back-propagate
L_saR___ math e-=w|fire !
L_saR___ math backp|fire !
!
! Learn cycle - back propagate error. Store unscaled error in
! current error field.
!
L_saR___ lset out,-2 ! last local output layer
L_saR___ @lloop math ce=e|e*=f'|backp|fire
L_saR___ math learn|fire ! delayed learning for recurrence
L_saR___ lset cur,-1 ! previous layer
L_saR___ lcmp in ! at input layer ?
L_saR___ bgt @lloop ! loop till done
!
! Set up current error for instruments
!
L_saR_sa lset out ! Output layer
L_saR_sa math ce=e|e-=w|swap|fire
LisaRisa trace 0 ! turn off any trace function